﻿using DogModel;
using IDogRepository;
using Microsoft.Extensions.Logging;
using SqlSugar;

namespace DogRepository
{
    public class UserInfoRepository : BaseRepository<UserInfo>, IUserInfoRepository
    {
        protected readonly ISqlSugarClient _sqlSugarClient;

        public UserInfoRepository(ISqlSugarClient sqlSugarClient, ILogger<UserInfoRepository> logger) : base(sqlSugarClient, logger)
        {
            _sqlSugarClient = sqlSugarClient;
        }

        public UserInfo GetByName(UserInfo user)
        {
            return _sqlSugarClient.Queryable<UserInfo>().Where(a => a.Name == user.Name && a.PassWord == user.PassWord).First();
        }
    }
}